Extended the device parameter notation to include offsets using

'+' and '-' in the same way that '*' is currently used for specifying
a parameter scaling.  The combination of a scale and offset for the
same parameter has not (yet) been implemented.
This commit is contained in:
Tim Edwards
2023-06-21 20:44:38 -04:00
parent 482d7534a2
commit 07267dc126
8 changed files with 69 additions and 19 deletions
+16 -1
View File
@@ -2364,7 +2364,7 @@ ExtTechLine(sectionName, argc, argv)
subcktParams = NULL;
while ((paramName = strchr(argv[argc - 1], '=')) != NULL)
{
char *mult;
char *mult, *offset;
paramName++;
newParam = (ParamList *)mallocMagic(sizeof(ParamList));
@@ -2393,6 +2393,21 @@ ExtTechLine(sectionName, argc, argv)
else
newParam->pl_scale = 1.0;
if ((offset = strchr(paramName, '+')) != NULL)
{
*offset = '\0';
offset++;
newParam->pl_offset = atof(offset);
}
else if ((offset = strchr(paramName, '-')) != NULL)
{
*offset = '\0';
offset++;
newParam->pl_offset = -atof(offset);
}
else
newParam->pl_offset = 0.0;
newParam->pl_name = StrDup((char **)NULL, paramName);
newParam->pl_next = subcktParams;
subcktParams = newParam;