This class can be used to inform the progress of a task. More...
#include <TaskProgress.h>
Public Types | |
| enum | { UNDEFINED = 0, DRAW = 1 } |
| Defines some task types. More... | |
Public Member Functions | |
| void | cancel () |
| Cancel task, set the task active FALSE. More... | |
| int | getCurrentStep () const |
| Get the task current step. More... | |
| int | getId () const |
| Get the task identification. More... | |
| const std::string & | getMessage () const |
| Get the task message. More... | |
| int | getProportionalValue () const |
| Get the proportional value (value between 0 and 100). More... | |
| int | getTotalSteps () const |
| Get the task total stepes. More... | |
| unsigned int | getType () const |
| Get the task type. More... | |
| bool | hasToUpdate () const |
| This function is used when proportional value has changed. More... | |
| bool | isActive () const |
| Verify if the task is active. More... | |
| void | pulse () |
| Calls setCurrentStep() function using getCurrentStep() + 1. More... | |
| void | setCurrentStep (int value) |
| Set the task current step. More... | |
| void | setMessage (const std::string &message) |
| Set the task message. More... | |
| void | setTotalSteps (int value) |
| Set the task total stepes. More... | |
| TaskProgress (const std::string &message="", unsigned int type=UNDEFINED, int totalSteps=0) | |
| Default constructor. More... | |
| void | useMultiThread (bool flag) |
| Used to define if task is running in thread mode. More... | |
| void | useTimer (bool flag) |
| Used to define if task use progress timer information. More... | |
| ~TaskProgress () | |
| Destructor. More... | |
Protected Attributes | |
| int | m_currentPropStep |
| Current proportinal step. More... | |
| int | m_currentStep |
| Task current step. More... | |
| bool | m_hasToUpdate |
| Flag used to indicate the update status. More... | |
| int | m_id |
| Task identification. More... | |
| bool | m_isActive |
| Flag used to indicate the task status. More... | |
| bool | m_isMultiThread |
| Flag used to indicate the thread mode. More... | |
| std::string | m_message |
| Task message. More... | |
| ProgressTimer * | m_timer |
| Progress timer instance. More... | |
| int | m_totalSteps |
| Task total steps. More... | |
| unsigned int | m_type |
| Task type. More... | |
| bool | m_useTimer |
| Flag used to indicate the timer status. More... | |
This class can be used to inform the progress of a task.
Definition at line 53 of file TaskProgress.h.
| anonymous enum |
Defines some task types.
| Enumerator | |
|---|---|
| UNDEFINED |
Undefined task type. |
| DRAW |
Draw task type. |
Definition at line 58 of file TaskProgress.h.
| te::common::TaskProgress::TaskProgress | ( | const std::string & | message = "", |
| unsigned int | type = UNDEFINED, |
||
| int | totalSteps = 0 |
||
| ) |
Default constructor.
The constructor will register the task in the progress manager.
Definition at line 31 of file TaskProgress.cpp.
References te::common::ProgressManager::addTask(), te::common::Singleton< ProgressManager >::getInstance(), m_id, and setTotalSteps().
| te::common::TaskProgress::~TaskProgress | ( | ) |
Destructor.
The destructor will remove the task from the progress manager.
Definition at line 50 of file TaskProgress.cpp.
References te::common::Singleton< ProgressManager >::getInstance(), m_id, m_timer, and te::common::ProgressManager::removeTask().
| void te::common::TaskProgress::cancel | ( | ) |
Cancel task, set the task active FALSE.
Definition at line 162 of file TaskProgress.cpp.
References te::common::ProgressManager::cancelTask(), te::common::Singleton< ProgressManager >::getInstance(), m_currentPropStep, m_currentStep, m_id, m_isActive, and m_totalSteps.
Referenced by te::qt::widgets::ProgressViewerTaskWidget::cancel().
| int te::common::TaskProgress::getCurrentStep | ( | ) | const |
Get the task current step.
Definition at line 95 of file TaskProgress.cpp.
References m_currentStep.
Referenced by pulse(), and te::qt::widgets::ProgressViewerTaskWidget::updateValue().
| int te::common::TaskProgress::getId | ( | ) | const |
Get the task identification.
Definition at line 57 of file TaskProgress.cpp.
References m_id.
Referenced by te::qt::widgets::ProgressViewerTaskWidget::cancelTask(), te::qt::widgets::ProgressViewerTaskWidget::removeTask(), te::qt::widgets::ProgressViewerTaskWidget::setTask(), te::qt::widgets::ProgressViewerTaskWidget::setTotalValues(), te::qt::widgets::ProgressViewerTaskWidget::updateMessage(), and te::qt::widgets::ProgressViewerTaskWidget::updateValue().
| const std::string & te::common::TaskProgress::getMessage | ( | ) | const |
Get the task message.
Definition at line 144 of file TaskProgress.cpp.
References m_message.
Referenced by te::qt::widgets::ProgressViewerWidget::addTask(), and te::qt::widgets::ProgressViewerTaskWidget::updateMessage().
| int te::common::TaskProgress::getProportionalValue | ( | ) | const |
Get the proportional value (value between 0 and 100).
Definition at line 90 of file TaskProgress.cpp.
References m_currentPropStep.
| int te::common::TaskProgress::getTotalSteps | ( | ) | const |
Get the task total stepes.
Definition at line 67 of file TaskProgress.cpp.
References m_totalSteps.
Referenced by te::qt::widgets::ProgressViewerWidget::addTask(), te::qt::widgets::ProgressViewerTaskWidget::setTotalValues(), UploadProgress(), and useTimer().
| unsigned int te::common::TaskProgress::getType | ( | ) | const |
Get the task type.
Definition at line 62 of file TaskProgress.cpp.
References m_type.
| bool te::common::TaskProgress::hasToUpdate | ( | ) | const |
This function is used when proportional value has changed.
Definition at line 202 of file TaskProgress.cpp.
References m_hasToUpdate.
| bool te::common::TaskProgress::isActive | ( | ) | const |
Verify if the task is active.
Definition at line 157 of file TaskProgress.cpp.
References m_isActive.
Referenced by te::pgis::Transactor::add(), te::rp::Skeleton::applyVecDiffusion(), te::sa::BoxMap(), te::mnt::Tin::BreakTriangleSecondDeriv(), te::mnt::Tin::CalcNodeSecondDeriv(), te::mnt::SplineInterpolationGrassMitasova::calculateGrid(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), ConsoleSleeper(), ConsoleSleeperMultiThread(), te::sa::GPMConstructorDistanceStrategy::constructStrategy(), te::sa::GPMConstructorAdjacencyStrategy::constructStrategy(), te::cellspace::CellularSpacesOperations::createCellSpace(), te::mnt::TINGeneration::CreateDelaunay(), te::qt::widgets::createHistogram(), te::mnt::TINGeneration::CreateMinAngleTriangulation(), te::qt::widgets::createScatter(), te::sa::GPMConstructorAbstractStrategy::createVertexObjects(), te::sa::DataSetAdaptRadiusKernel(), te::sa::DataSetKernelNormalize(), te::sa::DataSetRatioKernel(), te::sa::DataSetStatRadiusKernel(), te::map::QueryLayerRenderer::drawDatSetGeometries(), te::map::AbstractLayerRenderer::drawDatSetGeometries(), te::map::AbstractLayerRenderer::drawDatSetTexts(), te::map::DrawGeometries(), te::map::AbstractLayerRenderer::drawLayerGrouping(), te::map::DrawRaster(), te::qt::widgets::RasterizationWizard::execute(), te::vp::Merge::executeMemory(), te::rp::ArithmeticOperations::executeString(), te::mnt::SplineInterpolationGrass::generateGrid(), te::sa::SamplePointsGeneratorRandom::generateSamples(), te::sa::SamplePointsGeneratorStratified::generateSamples(), te::sa::GlobalMoranSignificance(), te::sa::GridAdaptRadiusKernel(), te::sa::GridKernelNormalize(), te::sa::GridRatioKernel(), te::sa::GridStatRadiusKernel(), te::sa::GStatistics(), te::sa::SpatialWeightsExchanger::importFromGAL(), te::sa::SpatialWeightsExchanger::importFromGWT(), te::mnt::TINGeneration::InsertNodes(), te::sa::LISAMap(), te::sa::LisaStatisticalSignificance(), te::mnt::Tin::LoadTin(), te::sa::LocalMean(), te::vp::MakeGeometryValid::makeValidMemory(), te::sa::MoranIndex(), te::sa::MoranMap(), te::mnt::Tin::NodeFirstDeriv(), te::mnt::Tin::NodeSecondDeriv(), te::mnt::MNTGenerationDialog::onOkPushButtonClicked(), te::vp::CheckGeomValidityDialog::onVerifyPushButtonClicked(), te::vp::IntersectionMemory::pairwiseIntersection(), te::rst::Raster::rasterize(), te::mnt::TINGeneration::ReCreateDelaunay(), te::mnt::CreateIsolines::rstMemoryBlock(), te::mnt::TINCreateIsolines::run(), te::mnt::Slope::run(), te::vp::PolygonToLineMemory::run(), te::vp::LineToPolygonMemory::run(), te::attributefill::VectorToRaster::run(), te::attributefill::RasterToVector::run(), te::attributefill::VectorToVectorMemory::run(), te::sa::BayesGlobalOperation::runBayesGlobal(), te::sa::BayesLocalOperation::runBayesLocal(), te::mnt::Tin::SaveTin(), DummyWindow::showProgressBar(), DummyWindow::showThreadProgressBar(), te::mnt::TINGeneration::TestIsolines(), te::mnt::Tin::TriangleFirstDeriv(), te::mnt::Tin::TriangleSecondDeriv(), UploadProgress(), and te::sa::ZAndWZ().
| void te::common::TaskProgress::pulse | ( | ) |
Calls setCurrentStep() function using getCurrentStep() + 1.
Definition at line 136 of file TaskProgress.cpp.
References getCurrentStep(), and setCurrentStep().
Referenced by te::pgis::Transactor::add(), te::graph::AddDeepAttribute::AddDeepAttribute(), te::qt::widgets::LayerItemModel::addLayers(), te::graph::AddRasterAttribute::AddRasterAttribute(), te::sa::BoxMap(), te::mnt::Tin::BreakTriangleSecondDeriv(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), te::mnt::Tin::CalcNodeSecondDeriv(), te::mnt::SplineInterpolationGrassMitasova::calculateGrid(), te::cl::KMeans< TTRAIN, TCLASSIFY >::classify(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), ConsoleSleeper(), ConsoleSleeperMultiThread(), te::sa::GPMConstructorAdjacencyStrategy::constructStrategy(), te::sa::GPMConstructorDistanceStrategy::constructStrategy(), te::cellspace::CellularSpacesOperations::createCellSpace(), te::mnt::TINGeneration::CreateDelaunay(), te::graph::RAGGraphBuilder::createEdgeObjects(), te::qt::widgets::createHistogram(), te::mnt::TINGeneration::CreateMinAngleTriangulation(), te::qt::widgets::createScatter(), te::sa::GPMConstructorAbstractStrategy::createVertexObjects(), te::mnt::Volume::CVGrd(), te::sa::DataSetAdaptRadiusKernel(), te::sa::DataSetKernelNormalize(), te::sa::DataSetRatioKernel(), te::sa::DataSetStatRadiusKernel(), DownloadProgress(), te::map::QueryLayerRenderer::drawDatSetGeometries(), te::map::AbstractLayerRenderer::drawDatSetTexts(), te::map::DrawGeometries(), te::map::AbstractLayerRenderer::drawLayerGrouping(), te::map::DrawRaster(), te::qt::widgets::RasterizationWizard::execute(), te::rp::ClassifierKMeansStrategy::execute(), te::rp::ClassifierEMStrategy::execute(), te::vp::Merge::executeMemory(), te::rp::ArithmeticOperations::executeString(), te::mnt::SplineInterpolationGrass::generateGrid(), te::sa::SamplePointsGeneratorRandom::generateSamples(), te::sa::SamplePointsGeneratorStratified::generateSamples(), te::sa::GlobalMoranSignificance(), te::sa::GridAdaptRadiusKernel(), te::sa::GridKernelNormalize(), te::sa::GridRatioKernel(), te::sa::GridStatRadiusKernel(), te::sa::GStatistics(), te::sa::SpatialWeightsExchanger::importFromGAL(), te::sa::SpatialWeightsExchanger::importFromGWT(), te::mnt::TINGeneration::InsertBreakNodes(), te::mnt::TINGeneration::InsertNodes(), te::sa::LISAMap(), te::sa::LisaStatisticalSignificance(), te::mnt::Tin::LoadTin(), te::sa::LocalMean(), te::vp::MakeGeometryValid::makeValidMemory(), te::sa::MoranIndex(), te::sa::MoranMap(), te::mnt::Tin::NodeFirstDeriv(), te::mnt::Tin::NodeSecondDeriv(), te::mnt::MNTGenerationDialog::onOkPushButtonClicked(), te::vp::CheckGeomValidityDialog::onVerifyPushButtonClicked(), te::vp::IntersectionMemory::pairwiseIntersection(), te::rst::Raster::rasterize(), te::mnt::TINGeneration::ReCreateDelaunay(), te::mnt::CreateIsolines::rstMemoryBlock(), te::mnt::TINCreateIsolines::run(), te::mnt::Slope::run(), te::mnt::Smooth::run(), te::mnt::TINCalculateGrid::run(), te::mnt::CalculateGrid::run(), te::vp::PolygonToLineMemory::run(), te::vp::LineToPolygonMemory::run(), te::attributefill::VectorToRaster::run(), te::attributefill::RasterToVector::run(), te::rst::Vectorizer::run(), te::attributefill::VectorToVectorMemory::run(), te::sa::BayesGlobalOperation::runBayesGlobal(), te::sa::BayesLocalOperation::runBayesLocal(), te::mnt::SaveIso(), te::mnt::Tin::SaveTin(), DummyWindow::showProgressBar(), DummyWindow::showThreadProgressBar(), te::mnt::TINGeneration::TestIsolines(), te::cl::KMeans< TTRAIN, TCLASSIFY >::train(), te::mnt::Tin::TriangleFirstDeriv(), te::mnt::Tin::TriangleSecondDeriv(), and te::sa::ZAndWZ().
| void te::common::TaskProgress::setCurrentStep | ( | int | value | ) |
Set the task current step.
| value | Current value. |
Definition at line 100 of file TaskProgress.cpp.
References te::common::Singleton< ProgressManager >::getInstance(), te::common::ProgressTimer::getMessage(), m_currentPropStep, m_currentStep, m_hasToUpdate, m_id, m_isActive, m_timer, m_totalSteps, setMessage(), te::common::ProgressTimer::tick(), and te::common::ProgressManager::updateValue().
Referenced by te::rp::ClassifierKMeansStrategy::execute(), te::rp::ClassifierEMStrategy::execute(), te::qt::plugins::terramobile::GeoPackagePublisherDialog::onSetCurrentStep(), pulse(), and UploadProgress().
| void te::common::TaskProgress::setMessage | ( | const std::string & | message | ) |
Set the task message.
| message | String value with task message. |
Definition at line 149 of file TaskProgress.cpp.
References te::common::Singleton< ProgressManager >::getInstance(), m_id, m_message, and te::common::ProgressManager::updateMessage().
Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), te::sa::BoxMap(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), ConsoleSleeper(), ConsoleSleeperMultiThread(), te::sa::GPMConstructorAdjacencyStrategy::constructStrategy(), te::sa::GPMConstructorDistanceStrategy::constructStrategy(), te::graph::RAGGraphBuilder::createEdgeObjects(), te::qt::widgets::createHistogram(), te::qt::widgets::createNormalDistribution(), te::qt::widgets::createScatter(), te::sa::GPMConstructorAbstractStrategy::createVertexObjects(), te::sa::DataSetAdaptRadiusKernel(), te::sa::DataSetKernelNormalize(), te::sa::DataSetRatioKernel(), te::sa::DataSetStatRadiusKernel(), DownloadProgress(), te::qt::widgets::RasterizationWizard::execute(), te::rp::ClassifierKMeansStrategy::execute(), te::rp::ClassifierEMStrategy::execute(), te::sa::SamplePointsGeneratorRandom::generateSamples(), te::sa::SamplePointsGeneratorStratified::generateSamples(), te::ws::ogc::wcs::qt::WCSLayerSelector::getLayers(), te::sa::GlobalMoranSignificance(), te::sa::GridAdaptRadiusKernel(), te::sa::GridKernelNormalize(), te::sa::GridRatioKernel(), te::sa::GridStatRadiusKernel(), te::sa::GStatistics(), te::sa::SpatialWeightsExchanger::importFromGAL(), te::sa::SpatialWeightsExchanger::importFromGWT(), te::sa::LISAMap(), te::sa::LisaStatisticalSignificance(), te::sa::LocalMean(), te::sa::MoranIndex(), te::sa::MoranMap(), te::rst::Raster::rasterize(), te::sa::BayesGlobalOperation::runBayesGlobal(), te::sa::BayesLocalOperation::runBayesLocal(), setCurrentStep(), DummyWindow::showProgressBar(), UploadProgress(), and te::sa::ZAndWZ().
| void te::common::TaskProgress::setTotalSteps | ( | int | value | ) |
Set the task total stepes.
| value | Interger value with total steps. |
Definition at line 72 of file TaskProgress.cpp.
References te::common::Singleton< ProgressManager >::getInstance(), m_id, m_timer, m_totalSteps, te::common::ProgressTimer::setTotalSteps(), te::common::ProgressManager::setTotalValues(), and te::common::ProgressTimer::start().
Referenced by te::pgis::Transactor::add(), te::graph::AddDeepAttribute::AddDeepAttribute(), te::qt::widgets::LayerItemModel::addLayers(), te::graph::AddRasterAttribute::AddRasterAttribute(), te::sa::SpatialWeightsExchanger::associateGeometry(), te::sa::BoxMap(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), ConsoleSleeper(), ConsoleSleeperMultiThread(), te::sa::GPMConstructorDistanceStrategy::constructStrategy(), te::sa::GPMConstructorAdjacencyStrategy::constructStrategy(), te::cellspace::CellularSpacesOperations::createCellSpace(), te::graph::RAGGraphBuilder::createEdgeObjects(), te::qt::widgets::createHistogram(), te::qt::widgets::createNormalDistribution(), te::qt::widgets::createScatter(), te::sa::GPMConstructorAbstractStrategy::createVertexObjects(), te::sa::DataSetAdaptRadiusKernel(), te::sa::DataSetKernelNormalize(), te::sa::DataSetRatioKernel(), te::sa::DataSetStatRadiusKernel(), te::qt::widgets::RasterizationWizard::execute(), te::rp::ClassifierKMeansStrategy::execute(), te::rp::ClassifierEMStrategy::execute(), te::vp::Merge::executeMemory(), te::sa::SpatialWeightsExchanger::exportToGAL(), te::sa::SpatialWeightsExchanger::exportToGWT(), te::sa::SamplePointsGeneratorRandom::generateSamples(), te::sa::SamplePointsGeneratorStratified::generateSamples(), te::ws::ogc::wcs::qt::WCSLayerSelector::getLayers(), te::sa::GlobalMoranSignificance(), te::sa::GridAdaptRadiusKernel(), te::sa::GridKernelNormalize(), te::sa::GridRatioKernel(), te::sa::GridStatRadiusKernel(), te::sa::GStatistics(), te::sa::SpatialWeightsExchanger::importFromGAL(), te::sa::SpatialWeightsExchanger::importFromGWT(), te::sa::LISAMap(), te::sa::LisaStatisticalSignificance(), te::sa::LocalMean(), te::vp::MakeGeometryValid::makeValidMemory(), te::sa::MoranIndex(), te::sa::MoranMap(), te::qt::plugins::terramobile::GeoPackagePublisherDialog::onSetCurrentStep(), te::vp::CheckGeomValidityDialog::onVerifyPushButtonClicked(), te::vp::IntersectionMemory::pairwiseIntersection(), te::rst::Raster::rasterize(), te::mnt::TINCreateIsolines::run(), te::vp::LineToPolygonMemory::run(), te::vp::PolygonToLineMemory::run(), te::attributefill::VectorToRaster::run(), te::attributefill::RasterToVector::run(), te::attributefill::VectorToVectorMemory::run(), te::sa::BayesGlobalOperation::runBayesGlobal(), te::sa::BayesLocalOperation::runBayesLocal(), DummyWindow::showProgressBar(), TaskProgress(), UploadProgress(), and te::sa::ZAndWZ().
| void te::common::TaskProgress::useMultiThread | ( | bool | flag | ) |
Used to define if task is running in thread mode.
| flag | Boolean value used to set the thread option. |
Definition at line 174 of file TaskProgress.cpp.
References m_isMultiThread, m_timer, and m_useTimer.
Referenced by ConsoleSleeperMultiThread().
| void te::common::TaskProgress::useTimer | ( | bool | flag | ) |
Used to define if task use progress timer information.
| flag | Boolean value used to set the timer option. |
Definition at line 187 of file TaskProgress.cpp.
References getTotalSteps(), m_isMultiThread, m_message, m_timer, m_useTimer, and te::common::ProgressTimer::start().
Referenced by te::pgis::Transactor::add(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), ConsoleSleeperMultiThread(), te::cellspace::CellularSpacesOperations::createCellSpace(), te::vp::Merge::executeMemory(), te::vp::IntersectionMemory::pairwiseIntersection(), te::vp::PolygonToLineMemory::run(), te::vp::LineToPolygonMemory::run(), te::attributefill::VectorToRaster::run(), te::attributefill::RasterToVector::run(), te::attributefill::VectorToVectorMemory::run(), DummyWindow::showProgressBar(), and DummyWindow::showThreadProgressBar().
|
protected |
Current proportinal step.
Definition at line 181 of file TaskProgress.h.
Referenced by cancel(), getProportionalValue(), and setCurrentStep().
|
protected |
Task current step.
Definition at line 180 of file TaskProgress.h.
Referenced by cancel(), getCurrentStep(), and setCurrentStep().
|
protected |
Flag used to indicate the update status.
Definition at line 183 of file TaskProgress.h.
Referenced by hasToUpdate(), and setCurrentStep().
|
protected |
Task identification.
Definition at line 177 of file TaskProgress.h.
Referenced by cancel(), getId(), setCurrentStep(), setMessage(), setTotalSteps(), TaskProgress(), and ~TaskProgress().
|
protected |
Flag used to indicate the task status.
Definition at line 184 of file TaskProgress.h.
Referenced by cancel(), isActive(), and setCurrentStep().
|
protected |
Flag used to indicate the thread mode.
Definition at line 185 of file TaskProgress.h.
Referenced by useMultiThread(), and useTimer().
|
protected |
Task message.
Definition at line 182 of file TaskProgress.h.
Referenced by getMessage(), setMessage(), and useTimer().
|
protected |
Progress timer instance.
Definition at line 187 of file TaskProgress.h.
Referenced by setCurrentStep(), setTotalSteps(), useMultiThread(), useTimer(), and ~TaskProgress().
|
protected |
Task total steps.
Definition at line 179 of file TaskProgress.h.
Referenced by cancel(), getTotalSteps(), setCurrentStep(), and setTotalSteps().
|
protected |
|
protected |
Flag used to indicate the timer status.
Definition at line 186 of file TaskProgress.h.
Referenced by useMultiThread(), and useTimer().