Added checks for GDS scalefactor (DBU) both when reading GDS in

"gds readonly true" mode and when writing a GDS file in full-dump
mode.  Reading or writing a file with an incompatible DBU is now
prohibited.  This is not a great solution, as it forces the
original file to be rewritten with a different DBU.  Preferably
there should be code to scale the units during a dump, but that
needs to be coded.
This commit is contained in:
Tim Edwards
2023-11-21 09:44:16 -05:00
parent 5352a23577
commit 21336607e0
5 changed files with 54 additions and 11 deletions
+10 -4
View File
@@ -706,7 +706,7 @@ calmaFullDump(def, fi, outf, filename)
static int hdrSkip[] = { CALMA_FORMAT, CALMA_MASK, CALMA_ENDMASKS,
CALMA_REFLIBS, CALMA_FONTS, CALMA_ATTRTABLE,
CALMA_STYPTABLE, CALMA_GENERATIONS, CALMA_UNITS, -1 };
CALMA_STYPTABLE, CALMA_GENERATIONS, -1 };
static int skipBeforeLib[] = { CALMA_LIBDIRSIZE, CALMA_SRFNAME,
CALMA_LIBSECUR, -1 };
@@ -722,11 +722,17 @@ calmaFullDump(def, fi, outf, filename)
calmaSkipSet(skipBeforeLib);
if (!calmaReadStringRecord(CALMA_LIBNAME, &libname)) goto done;
// NOTE: CALMA_UNITS needs to be parsed to determine if units in
// the input file are compatible with units being used in the output
// file.
calmaSkipSet(hdrSkip);
// CALMA_UNITS needs to be parsed to determine if units in the
// input file are compatible with units being used in the output
// file.
if (calmaParseUnits() == FALSE)
{
TxError("Error: Library %s has incompatible database units!\n", libname);
return;
}
// Record the GDS library so it will not be processed again.
he = HashFind(&calmaLibHash, filename);
if ((char *)HashGetValue(he) != NULL)