All Projects → goblinfactory → Progress Bar

goblinfactory / Progress Bar

Licence: other
Multiplatform netstandard 2.0 C# console progress bar, with support for single or multithreaded progress updates.

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Progress Bar

Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+38828.3%)
Mutual labels:  console, progress, progressbar
Python Progressbar
Progressbar 2 - A progress bar for Python 2 and Python 3 - "pip install progressbar2"
Stars: ✭ 682 (+1186.79%)
Mutual labels:  console, progress, progressbar
Progress
Progress replacing ProgressDialog
Stars: ✭ 52 (-1.89%)
Mutual labels:  progress, progressbar
Pterm
✨ #PTerm is a modern go module to beautify console output. Featuring charts, progressbars, tables, trees, and many more 🚀 It's completely configurable and 100% cross-platform compatible.
Stars: ✭ 449 (+747.17%)
Mutual labels:  console, progressbar
Spincounterview
🎡 一个类似于码表变化的旋转计数器动画控件
Stars: ✭ 47 (-11.32%)
Mutual labels:  progress, progressbar
VHProgressBar
Vartical and Horizontal ProgressBar
Stars: ✭ 23 (-56.6%)
Mutual labels:  progress, progressbar
Progressstatusbar
Another way to show progress. A progress View over the system StatusBar.
Stars: ✭ 283 (+433.96%)
Mutual labels:  progress, progressbar
Theglowingloader
TheGlowingLoader is the highly configurable library to indicate progress and is natively created for Android Platform. It is an implementation of a design composed by Shashank Sahay.
Stars: ✭ 379 (+615.09%)
Mutual labels:  progress, progressbar
Multiprogressview
📊 An animatable view that depicts multiple progresses over time. Modeled after UIProgressView
Stars: ✭ 614 (+1058.49%)
Mutual labels:  progress, progressbar
Progressbar
Terminal-based progress bar for Java / JVM
Stars: ✭ 625 (+1079.25%)
Mutual labels:  console, progressbar
LineProgressbar
A light weight jquery progressbar plugin
Stars: ✭ 34 (-35.85%)
Mutual labels:  progress, progressbar
Roundprogresstextview
TextView with Round Pogress
Stars: ✭ 18 (-66.04%)
Mutual labels:  progress, progressbar
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-50.94%)
Mutual labels:  progress, progressbar
Circleprogressview
🎡 CircleProgressView是一个圆形渐变的进度动画控件(支持外环显示刻度,内环随之变化,配置参数完全可配),动画效果纵享丝滑。
Stars: ✭ 314 (+492.45%)
Mutual labels:  progress, progressbar
stqdm
stqdm is the simplest way to handle a progress bar in streamlit app.
Stars: ✭ 75 (+41.51%)
Mutual labels:  progress, progressbar
mp-progress
专注于小程序圆环形进度条的小工具
Stars: ✭ 72 (+35.85%)
Mutual labels:  progress, progressbar
react-sweet-progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 250 (+371.7%)
Mutual labels:  progress, progressbar
ProBar
this script will allow you to configure a progress bar with a timer with other options
Stars: ✭ 0 (-100%)
Mutual labels:  progress, progressbar
Consoleframework
Cross-platform toolkit for easy development of TUI applications.
Stars: ✭ 487 (+818.87%)
Mutual labels:  console, dotnetcore
Ngx Progressbar
Angular progress bar ☄
Stars: ✭ 813 (+1433.96%)
Mutual labels:  progress, progressbar

(Goblinfactory.Konsole) progress-bar

  • C# (dotnet standard) console progress bar with support for single or multithreaded progress updates.

Install-Package Goblinfactory.ProgressBar

Screenshot of progressbar demo using the double line progressbar, ProgressBarTwoLine.

InstallProgressBar

OSX Notes and limitations

  • Tested on OSX, and currently only works if there is no screen scrolling.
    • i.e. if you create progressbars and the screen scrolls when creating the progressbar, then the progressbars will not work correctly at present.

ProgressBar Usage

    using Goblinfactory.ProgressBar;

           . . .

            var pb = new ProgressBar(50);
            pb.Refresh(0, "connecting to server to download 50 files sychronously.");
            Console.ReadLine();

            pb.Refresh(25, "downloading file number 25");
            Console.ReadLine();
            pb.Refresh(50, "finished.");

produces the following output

Item 0     of 50   . (0  %)
connecting to server to download 50 files sychronously.

(press enter)

Item 25    of 50   . (50%) ######################################
downloading file number 25

(press enter again)

Item 50    of 50   . (100%) ############################################################################
finished.

example of showing status update for parallel tasks

This example creates 10 seperate console progress bars, each being updated on a seperate thread. (This code generates the output visible in the animated gif.)

            // demo; take the first 10 directories that have files from c:\windows, and then pretends to process (list) them.
            // processing of each directory happens on a different thread, to simulate multiple background tasks,
            // e.g. file downloading.
            // ==============================================================================================================
            var dirs = Directory.GetDirectories(@"c:\windows").Where(d=> Directory.GetFiles(d).Count()>0).Take(10);

            var tasks = new List<Task>();
            var bars = new List<ProgressBar>();
            foreach (var d in dirs)
            {
                var dir = new DirectoryInfo(d);
                var files = dir.GetFiles().Take(100).Select(f=>f.FullName).ToArray();
                if (files.Count()==0) continue;
                var bar = new ProgressBar(files.Count());
                bars.Add(bar);
                bar.Refresh(0, d);
                tasks.Add(new Task(() => ProcessFiles(d, files, bar)));
            }
            Console.WriteLine("ready press enter.");
            Console.ReadLine();

            foreach (var t in tasks) t.Start();
            Task.WaitAll(tasks.ToArray());
            Console.WriteLine("done.");
            Console.ReadLine();

        }

        public static void ProcessFiles(string directory, string[] files, ProgressBar bar)
        {
            var cnt = files.Count();
            foreach (var file in files)
            {
                bar.Next(new FileInfo(file).Name);
                Thread.Sleep(150);
            }
        }


Still Todo

  • support screen scrolling.
  • finish documentation for ProgressBarSlim and ProgressBar.
  • Include tests
  • more manual testing
  • Some cleanup work to be done on resetting the cursor position when lots of threads updating progressbars
  • I think we need to move all the lock objects to a shared static ConsoleLocker class, as the current locking can bleed in some very high (lots of threads using both ProgressBar, ProgressBarSlim as well as ThreadSafeWriter.)

Mac Screenshots

Multi threaded test using the default 1 line slim ProgressBar on mac ternimal.

Screenshot below is the output from the [QuickTest sample project] (QuickTest/Program.cs).

multi-threaded test in mac terminal

Useful links for future work

https://docs.microsoft.com/en-us/windows/console/console-screen-buffersdoub

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].