Improved error message (name the device instance)

when ac simulation and current or power are requested
This commit is contained in:
Holger Vogt 2020-09-26 13:13:18 +02:00
parent 644d8d0a3f
commit 51cfedc054
1 changed files with 2 additions and 4 deletions

View File

@ -137,9 +137,8 @@ RESask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
return(OK);
case RES_CURRENT:
if (ckt->CKTcurrentAnalysis & DOING_AC) {
errMsg = TMALLOC(char, strlen(msg) + 1);
errMsg = tprintf("%s: %s", inst->GENname, msg);
errRtn = "RESask";
strcpy(errMsg, msg);
return(E_ASKCURRENT);
} else if (ckt->CKTrhsOld) {
value->rValue = (*(ckt->CKTrhsOld + fast->RESposNode) -
@ -153,9 +152,8 @@ RESask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
}
case RES_POWER:
if (ckt->CKTcurrentAnalysis & DOING_AC) {
errMsg = TMALLOC(char, strlen(msg) + 1);
errMsg = tprintf("%s: %s", inst->GENname, msg);
errRtn = "RESask";
strcpy(errMsg, msg);
return(E_ASKPOWER);
} else if (ckt->CKTrhsOld) {
value->rValue = (*(ckt->CKTrhsOld + fast->RESposNode) -