Move statistic calculation to parser. Show Vertex and GFX count in GUI. CLI -A param is now broken. Will implement in next commits.

This commit is contained in:
2022-04-17 18:37:32 +02:00
parent 22bc3a18d7
commit c0ac6cc3c5
7 changed files with 96 additions and 131 deletions

View File

@@ -35,43 +35,7 @@
#include <gds-render/gds-utils/gds-types.h>
struct gds_cell_statistics {
size_t gfx_count;
size_t vertex_count;
size_t reference_count;
const struct gds_cell *cell;
};
struct gds_lib_statistics {
size_t gfx_count;
size_t vertex_count;
size_t reference_count;
size_t cell_count;
GList *cell_statistics;
const struct gds_library *library;
};
/**
* @brief Calculate statistics of a single cell
* @param[in] cell GDS cell
* @param[out] stat Statistics output
*/
void gds_statistics_calc_cell(const struct gds_cell *cell,
struct gds_cell_statistics *stat);
/**
* @brief Calc statistic information for library
* @param[in] library_list List containing all libraries
* @param[in,out] lib_stat_list Statistic list
*/
void gds_statistics_calc_library(GList * library_list,
GList ** lib_stat_list);
/**
* @brief Free library statistics GList
* @param[in,out] lib_stat_list List to free
*/
void gds_statistics_free_lib_stat_list(GList ** lib_stat_list);
void gds_statistics_calc_cummulative_counts_in_lib(struct gds_library *lib);
/** @} */

View File

@@ -65,6 +65,22 @@ struct gds_point {
int y;
};
struct gds_cell_statistics {
size_t gfx_count;
size_t vertex_count;
size_t total_vertex_count;
size_t total_gfx_count;
size_t reference_count;
};
struct gds_lib_statistics {
size_t gfx_count;
size_t vertex_count;
size_t reference_count;
size_t cell_count;
};
/**
* @brief Stores the result of the cell checks.
*/
@@ -127,6 +143,7 @@ struct gds_cell {
GList *graphic_objs; /**< @brief List of #gds_graphics */
struct gds_library *parent_library; /**< @brief Pointer to parent library */
struct gds_cell_checks checks; /**< @brief Checking results */
struct gds_cell_statistics stats; /**< @brief Optional statistic info */
};
/**
@@ -147,8 +164,10 @@ struct gds_library {
double unit_in_meters; /**< Length of a database unit in meters */
GList *cells; /**< List of #gds_cell that contains all cells in this library*/
GList *cell_names /**< List of strings that contains all cell names */;
struct gds_lib_statistics stats;
};
/** @} */
#endif /* __GDS_TYPES_H__ */