Example #1
0
        private static ChiaPlotStatus SetupChiaPlotStatus(CliOptions options)
        {
            var      configFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + Path.DirectorySeparatorChar;
            Settings Settings     = new Settings(configFolder + "ChiaPlotStatu.config.json");

            Settings.Load();
            ChiaPlotStatus PlotManager = new(Settings);
            List <string>  folders     = options.LogFolders.ToList();

            if (folders.Count() == 0)
            {
                if (PlotManager.Settings.LogDirectories.Count == 0)
                {
                    PlotManager.AddDefaultLogFolder();
                }
            }
            else
            {
                // override LogFolders from settings file
                PlotManager.Settings.LogDirectories.Clear();
                foreach (var folder in folders)
                {
                    PlotManager.AddLogFolder(folder);
                }
            }

            return(PlotManager);
        }
Example #2
0
        private static Filter SetupFilter(CliOptions options)
        {
            Filter filter = new();

            filter.HideHealthy       = options.HideHealthy;
            filter.HideFinished      = options.HideFinished;
            filter.HidePossiblyDead  = options.HidePossiblyDead;
            filter.HideConfirmedDead = options.HideConfirmedDead;
            return(filter);
        }
Example #3
0
        public static void GenerateReport(CliOptions options)
        {
            ChiaPlotStatus PlotManager  = SetupChiaPlotStatus(options);
            Filter         filter       = SetupFilter(options);
            string         sortProperty = options.SortProperty;

            if (string.IsNullOrEmpty(sortProperty))
            {
                sortProperty = "Progress";
            }
            Console.Out.WriteLine("Sorting by " + sortProperty);
            List <(PlotLog, PlotLogReadable)> plotLogs = PlotManager.PollPlotLogs(options.SortProperty, options.SortAsc, options.Search, filter);

            ExportToFile(options, plotLogs);
        }
Example #4
0
 private static void ExportToFile(CliOptions options, List <(PlotLog, PlotLogReadable)> plotLogs)