From 334cf9e5bde07d91cadaa31b8b3ddadb12150176 Mon Sep 17 00:00:00 2001 From: Daniel Baldwin Date: Sun, 10 Dec 2017 01:37:50 -0500 Subject: [PATCH] Adds a UI progress indicator --- .gitignore | 2 +- main.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3b9b6e9..d61f686 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /*.png /*.svg /*.gif - +/*.exe diff --git a/main.go b/main.go index 75d776c..c892e4d 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,9 @@ import ( "github.com/fogleman/primitive/primitive" "github.com/nfnt/resize" + + "github.com/sbwhitecap/tqdm" + ) var ( @@ -161,7 +164,7 @@ func main() { primitive.Log(1, "count=%d, mode=%d, alpha=%d, repeat=%d\n", config.Count, config.Mode, config.Alpha, config.Repeat) - for i := 0; i < config.Count; i++ { + tqdm.R(0, config.Count, func(i interface{}) (brk bool) { frame++ // find optimal shape and add it to the model @@ -199,6 +202,7 @@ func main() { } } } - } + return; + }) } }