mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-22 14:17:43 +02:00
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:
+16
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user