From ba51a437a425259b5d049cd0ff0d1d4d55fc8309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sun, 19 Apr 2020 02:57:15 +0200 Subject: [PATCH 1/2] Fix definition of datatype in GDS graphics type --- include/gds-render/gds-utils/gds-types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gds-render/gds-utils/gds-types.h b/include/gds-render/gds-utils/gds-types.h index bb112c5..270dc43 100644 --- a/include/gds-render/gds-utils/gds-types.h +++ b/include/gds-render/gds-utils/gds-types.h @@ -101,7 +101,7 @@ struct gds_graphics { enum path_type path_render_type; /**< @brief Line cap */ int width_absolute; /**< @brief Width. Not used for objects other than paths */ int16_t layer; /**< @brief Layer the graphic object is on */ - uint16_t datatype; + int16_t datatype; /**< @brief Data type of graphic object */ }; /** From ceeb67355dc4f14fe7e204a267448dfed39b6951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sun, 19 Apr 2020 02:58:34 +0200 Subject: [PATCH 2/2] Fix #38: Make parser store the datatype record of a graphics object --- gds-utils/gds-parser.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gds-utils/gds-parser.c b/gds-utils/gds-parser.c index b4db861..7c32229 100644 --- a/gds-utils/gds-parser.c +++ b/gds-utils/gds-parser.c @@ -80,6 +80,7 @@ enum gds_record { STRANS = 0x1A01, BOX = 0x2D00, LAYER = 0x0D02, + DATATYPE = 0x0E02, WIDTH = 0x0F03, PATHTYPE = 0x2102, COLROW = 0x1302, @@ -867,6 +868,7 @@ int parse_gds_from_file(const char *filename, GList **library_list) case LIBNAME: case SNAME: case LAYER: + case DATATYPE: case STRNAME: break; default: @@ -1003,6 +1005,16 @@ int parse_gds_from_file(const char *filename, GList **library_list) } GDS_INF("\t\tAdded layer %d\n", (int)current_graphics->layer); break; + case DATATYPE: + if (!current_graphics) { + GDS_WARN("Datatype has to be defined inside graphics object. Probably unknown object. Implement it yourself!"); + break; + } + current_graphics->datatype = gds_convert_signed_int16(workbuff); + if (current_graphics->datatype < 0) + GDS_WARN("Datatype negative!"); + GDS_INF("\t\tAdded datatype %d\n", (int)current_graphics->datatype); + break; case MAG: if (rec_data_length != 8) { GDS_WARN("Magnification is not an 8 byte real. Results may be wrong");