Exemplo n.º 1
0
 private static bool IsCountablePreprocessStep(EProgramStep pStep)
 {
     return(IsPreprocessStep(pStep) &&
            pStep != EProgramStep.Pre_Tile &&
            pStep != EProgramStep.Pre_DeleteTmp &&
            pStep != EProgramStep.Pre_Split &&
            pStep != EProgramStep.Pre_LasToTxt &&
            pStep != EProgramStep.Pre_LasReverseTile);
 }
Exemplo n.º 2
0
        public static void Step(EProgramStep pStep)
        {
            string tileProgress = GetTileProgress(pStep);

            lastTextProgress = tileProgress + GetStepText(pStep);

            string[] message = new[] { lastTextProgress };
            if (pStep == EProgramStep.Exception)
            {
                CAnalytics.WriteErrors();
                return;
            }

            CProjectData.backgroundWorker.ReportProgress(0, message);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Steps from preprocessing are not counted
        /// </summary>
        private static bool IsCountableStep(EProgramStep pStep)
        {
            //todo: tmp hack for preprocessing steps
            if (IsPreprocessStep(pStep))
            {
                return(false);
            }

            switch (pStep)
            {
            case EProgramStep.Exception:
            case EProgramStep.Cancelled:
            case EProgramStep.LoadReftrees:
                return(false);
            }
            return(true);
        }
Exemplo n.º 4
0
        private static string GetStepText(EProgramStep pStep)
        {
            if (pStep == EProgramStep.Exception)
            {
                return("EXCEPTION");
            }

            stepCallCount++;
            int maxSteps = countedStepsCount;

            stepCallCount = Math.Min(stepCallCount, maxSteps);             //bug: sometimes writes higher value
            string progress = IsCountableStep(pStep) ?
                              stepCallCount + "/" + maxSteps + ": " : "";
            string text = GetStepString(pStep);

            return(progress + text);
        }
Exemplo n.º 5
0
        private static string GetTileProgress(EProgramStep pStep)
        {
            //if(!IsCountableStep(pStep))
            //	return "";
            bool isPreprocess = IsPreprocessStep(pStep);

            string progress;

            if (isPreprocess)
            {
                if (IsCountablePreprocessStep(pStep))
                {
                    progress =
                        $"{CPreprocessController.currentTileIndex + 1} / {CPreprocessController.tilesCount}";
                }
                else
                {
                    progress = "---";
                }
            }
            else
            {
                if (IsCountableStep(pStep))
                {
                    progress = $"{CProgramStarter.currentTileIndex + 1} / {CProgramStarter.tilesCount}";
                }
                else
                {
                    progress = "---";
                }
            }

            string nl  = Environment.NewLine;
            string sep = "==========";

            return($"{sep}{nl}TILE: {progress} {nl}{sep}{nl}");
        }
Exemplo n.º 6
0
        private static string GetStepString(EProgramStep pStep)
        {
            string text;

            switch (pStep)
            {
            case EProgramStep.LoadLines:
                text = "load forest file lines";
                break;

            case EProgramStep.ParseLines:
                text = "parse forest file lines";
                break;

            case EProgramStep.ProcessGroundPoints:
                text = "process ground points";
                break;

            case EProgramStep.ProcessVegePoints:
                text = "process vege points";
                break;

            case EProgramStep.PreprocessVegePoints:
                text = "preprocess vege points";
                break;

            case EProgramStep.ValidateTrees1:
                text = "first tree validation";
                break;

            case EProgramStep.MergeTrees1:
                text = "first tree merge";
                break;

            case EProgramStep.ValidateTrees2:
                text = "second tree validation";
                break;

            case EProgramStep.MergeTrees2:
                text = "second tree merging";
                break;

            case EProgramStep.ValidateTrees3:
                text = "final tree validation";
                break;

            case EProgramStep.LoadReftrees:
                text = "loading reftrees";
                break;

            case EProgramStep.AssignReftrees:
                text = "assigning reftrees";
                break;

            //case EProgramStep.LoadCheckTrees:
            //	text = "loading checktrees";
            //	break;
            //case EProgramStep.AssignCheckTrees:
            //	text = "assigning checktrees";
            //	break;
            case EProgramStep.Export3D:
                text = "exporting 3d model";
                break;

            case EProgramStep.ExportMainFiles:
                text = "exporting main files";
                break;

            case EProgramStep.Bitmap:
                text = "generating bitmaps";

                break;

            case EProgramStep.Analytics:
                text = "exporting analytics";
                break;

            case EProgramStep.Dart:
                text = "exporting dart";
                break;

            case EProgramStep.Shp:
                text = "exporting shp";
                break;

            case EProgramStep.Las:
                text = "exporting las";
                break;


            case EProgramStep.Done:
                text = "DONE";
                break;


            case EProgramStep.Pre_Tile:
                text = PREPROCESS + "creating tiles";
                break;

            case EProgramStep.Pre_Noise:
                text = PREPROCESS + "removing noise";
                break;

            case EProgramStep.Pre_LasGround:
                text = PREPROCESS + "detecting ground";
                break;

            case EProgramStep.Pre_LasHeight:
                text = PREPROCESS + "calculating heights";
                break;

            case EProgramStep.Pre_LasClassify:
                text = PREPROCESS + "classifying points";
                break;

            case EProgramStep.Pre_LasReverseTile:
                text = PREPROCESS + "applying reverse tiling";
                break;

            case EProgramStep.Pre_DeleteTmp:
                text = PREPROCESS + "deleting temporary files";
                break;

            case EProgramStep.Pre_Split:
                text = PREPROCESS + "splitting file";
                break;

            case EProgramStep.Pre_LasToTxt:
                text = PREPROCESS + "converting from laz to txt";
                break;


            default:
                text = $"{pStep} - comment not specified";
                break;
            }

            return(text);
        }
Exemplo n.º 7
0
 private static bool IsPreprocessStep(EProgramStep pStep)
 {
     return(pStep.ToString().Contains("Pre_"));
 }