.. oe:namespace:: OESystem


.. _OESystem_OEConsoleProgressTracer:

.. oe:class:: OEConsoleProgressTracer

   .. oe:api::

      class OEConsoleProgressTracer : public OETracerBase

   The following methods are publicly inherited from :ref:`OETracerBase <OESystem_OETracerBase>`:

   ========================================================== ========================================================== ===========================================================
   :oe:meth:`Aborted<OESystem::OETracerBase::Aborted>`        :oe:meth:`Push<OESystem::OETracerBase::Push>`              :oe:meth:`SetProgress<OESystem::OETracerBase::SetProgress>`
   :oe:meth:`Pop<OESystem::OETracerBase::Pop>`                :oe:meth:`Refresh<OESystem::OETracerBase::Refresh>`        :oe:meth:`SetTask<OESystem::OETracerBase::SetTask>`
   ========================================================== ========================================================== ===========================================================

   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEConsoleProgressTracer()

      .. oe:language:: python

         .. oe:api:: python

            OEConsoleProgressTracer() -> OEConsoleProgressTracer

      Default constructor.

   .. oe:method:: Aborted

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool Aborted()

      .. oe:language:: python

         .. oe:api:: python

            Aborted() -> bool

      This is a no-op method for this class.

   .. oe:method:: Pop

      .. oe:language:: c++ java csharp

         .. oe:api::

            void Pop()

      .. oe:language:: python

         .. oe:api:: python

            Pop() -> None

      Prints out the task name and the progress bar along with the elapsed time.
      An example output is shown below.

      ::

        Screen generation        [========----------------------------------------------------]  13.53%  00:00:53

   .. oe:method:: Push

      .. oe:language:: c++ java csharp

         .. oe:api::

            void Push(std::string task)

      .. oe:language:: python

         .. oe:api:: python

            Push(task: str) -> None

      This is equivalent to calling :oe:meth:`OESystem::OEConsoleProgressTracer::SetTask`.

   .. oe:method:: Refresh

      .. oe:language:: c++ java csharp

         .. oe:api::

            void Refresh()

      .. oe:language:: python

         .. oe:api:: python

            Refresh() -> None

      This is a no-op method for this class.

   .. oe:method:: SetProgress

      .. oe:language:: c++ java csharp

         .. oe:api::

            void SetProgress(double percent)
            void SetProgress(unsigned int current, unsigned int total)

      .. oe:language:: python

         .. oe:api:: python

            SetProgress(percent: float) -> None
            SetProgress(current: int, total: int) -> None

      Prints out the task name and its progress bar when the current progress
      of the task has reached the percentage of completion specified by ``percent``
      or by ``current`` / ``total``.

   .. oe:method:: SetTask

      .. oe:language:: c++ java csharp

         .. oe:api::

            void SetTask(std::string task)

      .. oe:language:: python

         .. oe:api:: python

            SetTask(task: str) -> None

      Registers the tracer with a task name specified by, ``task``.
      It also starts the timer to trace the progress of the task and prints out
      the initial progress bar, i.e. ``0.0``.
