Compare commits

..

No commits in common. "15ff68ea741dd8e1bd64a5ddff48569c082ddf65" and "a3be13bc7ca9b434b832ba4d1fc82aabe06b01c8" have entirely different histories.

3 changed files with 6 additions and 27 deletions

View File

@ -48,12 +48,6 @@
#include <math.h> #include <math.h>
#include <cairo.h> #include <cairo.h>
/**
* @brief Default units assumed for library.
* @note This value is usually overwritten with the value defined in the library.
*/
#define GDS_DEFAULT_UNITS (10E-9)
#define GDS_ERROR(fmt, ...) printf("[PARSE_ERROR] " fmt "\n", ##__VA_ARGS__) /**< @brief Print GDS error*/ #define GDS_ERROR(fmt, ...) printf("[PARSE_ERROR] " fmt "\n", ##__VA_ARGS__) /**< @brief Print GDS error*/
#define GDS_WARN(fmt, ...) printf("[PARSE_WARNING] " fmt "\n", ##__VA_ARGS__) /**< @brief Print GDS warning */ #define GDS_WARN(fmt, ...) printf("[PARSE_WARNING] " fmt "\n", ##__VA_ARGS__) /**< @brief Print GDS warning */
@ -227,7 +221,7 @@ static GList *append_library(GList *curr_list, struct gds_library **library_ptr)
if (lib) { if (lib) {
lib->cells = NULL; lib->cells = NULL;
lib->name[0] = 0; lib->name[0] = 0;
lib->unit_in_meters = GDS_DEFAULT_UNITS; // Default. Will be overwritten lib->unit_to_meters = 1; // Default. Will be overwritten
lib->cell_names = NULL; lib->cell_names = NULL;
} else } else
return NULL; return NULL;
@ -389,7 +383,7 @@ static int name_cell(struct gds_cell *cell, unsigned int bytes,
return -1; return -1;
} }
data[bytes] = 0; // Append '0' data[bytes] = 0; // Append '0'
len = (int)strlen(data); len = strlen(data);
if (len > CELL_NAME_MAX-1) { if (len > CELL_NAME_MAX-1) {
GDS_ERROR("Cell name '%s' too long: %d\n", data, len); GDS_ERROR("Cell name '%s' too long: %d\n", data, len);
return -1; return -1;
@ -716,8 +710,6 @@ int parse_gds_from_file(const char *filename, GList **library_list)
break; break;
case PATHTYPE: case PATHTYPE:
break; break;
case UNITS:
break;
default: default:
//GDS_WARN("Record: %04x, len: %u", (unsigned int)rec_type, (unsigned int)rec_data_length); //GDS_WARN("Record: %04x, len: %u", (unsigned int)rec_type, (unsigned int)rec_data_length);
break; break;
@ -739,6 +731,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
switch (rec_type) { switch (rec_type) {
case HEADER: case HEADER:
case UNITS:
case ENDLIB: case ENDLIB:
case ENDSTR: case ENDSTR:
case BOUNDARY: case BOUNDARY:
@ -749,20 +742,6 @@ int parse_gds_from_file(const char *filename, GList **library_list)
case INVALID: case INVALID:
break; break;
case UNITS:
if (!current_lib) {
GDS_WARN("Units defined outside of library!\n");
break;
}
if (rec_data_length != 16) {
GDS_WARN("Unit define incomplete. Will assume database unit of %E meters\n", current_lib->unit_in_meters);
break;
}
current_lib->unit_in_meters = gds_convert_double(&workbuff[8]);
GDS_INF("Length of database unit: %E meters\n", current_lib->unit_in_meters);
break;
case BGNLIB: case BGNLIB:
/* Parse date record */ /* Parse date record */
gds_parse_date(workbuff, read, &current_lib->mod_time, &current_lib->access_time); gds_parse_date(workbuff, read, &current_lib->mod_time, &current_lib->access_time);

View File

@ -113,7 +113,7 @@ struct gds_library {
char name[CELL_NAME_MAX]; char name[CELL_NAME_MAX];
struct gds_time_field mod_time; struct gds_time_field mod_time;
struct gds_time_field access_time; struct gds_time_field access_time;
double unit_in_meters; /**< Length of a database unit in meters */ double unit_to_meters; /**< @warning not yet implemented */
GList *cells; /**< List of #gds_cell that contains all cells in this library*/ GList *cells; /**< List of #gds_cell that contains all cells in this library*/
GList *cell_names /**< List of strings that contains all cell names */; GList *cell_names /**< List of strings that contains all cell names */;
}; };

View File

@ -202,7 +202,7 @@ end_destroy:
static void on_convert_clicked(gpointer button, gpointer user) static void on_convert_clicked(gpointer button, gpointer user)
{ {
static struct render_settings sett = { static struct render_settings sett = {
.scale = 1000.0, .scale = 1000.0f,
.renderer = RENDERER_LATEX_TIKZ, .renderer = RENDERER_LATEX_TIKZ,
}; };
struct convert_button_data *data = (struct convert_button_data *)user; struct convert_button_data *data = (struct convert_button_data *)user;