-
-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detailed timing logging for layer export
- Loading branch information
1 parent
ea0436e
commit 13a059e
Showing
10 changed files
with
175 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,78 @@ | ||
//Copyright (c) 2018 Ultimaker B.V. | ||
//CuraEngine is released under the terms of the AGPLv3 or higher. | ||
// Copyright (c) 2018 Ultimaker B.V. | ||
// CuraEngine is released under the terms of the AGPLv3 or higher. | ||
|
||
#ifndef PROGRESS_H | ||
#define PROGRESS_H | ||
|
||
#include <string> | ||
|
||
#include "utils/gettime.h" | ||
|
||
namespace cura | ||
{ | ||
|
||
class TimeKeeper; | ||
struct LayerIndex; | ||
|
||
#define N_PROGRESS_STAGES 7 | ||
|
||
/*! | ||
* Class for handling the progress bar and the progress logging. | ||
* | ||
* | ||
* The progress bar is based on a single slicing of a rather large model which needs some complex support; | ||
* the relative timing of each stage is currently based on that of the slicing of dragon_65_tilted_large.stl | ||
*/ | ||
class Progress | ||
class Progress | ||
{ | ||
public: | ||
/*! | ||
* The stage in the whole slicing process | ||
* The stage in the whole slicing process | ||
*/ | ||
enum class Stage : unsigned int | ||
{ | ||
START = 0, | ||
SLICING = 1, | ||
PARTS = 2, | ||
INSET_SKIN = 3, | ||
SUPPORT = 4, | ||
EXPORT = 5, | ||
FINISH = 6 | ||
START = 0, | ||
SLICING = 1, | ||
PARTS = 2, | ||
INSET_SKIN = 3, | ||
SUPPORT = 4, | ||
EXPORT = 5, | ||
FINISH = 6 | ||
}; | ||
|
||
private: | ||
static double times [N_PROGRESS_STAGES]; //!< Time estimates per stage | ||
static double times[N_PROGRESS_STAGES]; //!< Time estimates per stage | ||
static std::string names[N_PROGRESS_STAGES]; //!< name of each stage | ||
static double accumulated_times [N_PROGRESS_STAGES]; //!< Time past before each stage | ||
static double accumulated_times[N_PROGRESS_STAGES]; //!< Time past before each stage | ||
static double total_timing; //!< An estimate of the total time | ||
/*! | ||
* Give an estimate between 0 and 1 of how far the process is. | ||
* | ||
* | ||
* \param stage The current stage of processing | ||
* \param stage_process How far we currently are in the \p stage | ||
* \return An estimate of the overall progress. | ||
*/ | ||
static float calcOverallProgress(Stage stage, float stage_progress); | ||
|
||
public: | ||
static void init(); //!< Initialize some values needed in a fast computation of the progress | ||
/*! | ||
* Message progress over the CommandSocket and to the terminal (if the command line arg '-p' is provided). | ||
* | ||
* | ||
* \param stage The current stage of processing | ||
* \param progress_in_stage Any number giving the progress within the stage | ||
* \param progress_in_stage_max The maximal value of \p progress_in_stage | ||
*/ | ||
static void messageProgress(Stage stage, int progress_in_stage, int progress_in_stage_max); | ||
/*! | ||
* Message the progress stage over the command socket. | ||
* | ||
* | ||
* \param stage The current stage | ||
* \param timeKeeper The stapwatch keeping track of the timings for each stage (optional) | ||
*/ | ||
static void messageProgressStage(Stage stage, TimeKeeper* timeKeeper); | ||
|
||
static void messageProgressLayer(LayerIndex layer_nr, size_t total_layers, double total_time, const TimeKeeper::RegisteredTimes& stages); | ||
}; | ||
|
||
|
||
} // name space cura | ||
#endif//PROGRESS_H | ||
} // namespace cura | ||
#endif // PROGRESS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.