Browse Source

get the plot name into the event job

pre-master-46
Holger Vogt 6 years ago
parent
commit
d72b4c415f
  1. 6
      src/frontend/outitf.c
  2. 1
      src/include/ngspice/evt.h
  3. 2
      src/xspice/evt/evtdest.c
  4. 17
      src/xspice/evt/evtsetup.c

6
src/frontend/outitf.c

@ -34,6 +34,7 @@ Modified: 2000 AlansFixes, 2013/2015 patch by Krzysztof Blaszkowski
extern char *spice_analysis_get_name(int index);
extern char *spice_analysis_get_description(int index);
extern int EVTsetup_plot(CKTcircuit* ckt, char* plotname);
static int beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analName,
@ -398,6 +399,11 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
plotInit(run);
if (refName)
run->runPlot->pl_ndims = 1;
#ifdef XSPICE
/* set the current plot name into the event job */
if (run->runPlot->pl_typename)
EVTsetup_plot(run->circuit, run->runPlot->pl_typename);
#endif
}
}

1
src/include/ngspice/evt.h

@ -335,6 +335,7 @@ struct Evt_Limit {
struct Evt_Job {
int num_jobs; /* Number of jobs run */
char **job_name; /* Names of different jobs */
char **job_plot; /* Names of different plots created by the job */
Evt_Node_Data_t **node_data; /* node_data for different jobs */
Evt_State_Data_t **state_data; /* state_data for different jobs */
Evt_Msg_Data_t **msg_data; /* messages for different jobs */

2
src/xspice/evt/evtdest.c

@ -260,6 +260,8 @@ Evt_Job_destroy(Evt_Job_t *job)
for (i = 0; i < job->num_jobs; i++)
tfree(job->job_name[i]);
for (i = 0; i < job->num_jobs; i++)
tfree(job->job_plot[i]);
tfree(job->job_name);
tfree(job->node_data);

17
src/xspice/evt/evtsetup.c

@ -61,7 +61,7 @@ static int EVTsetup_data(CKTcircuit *ckt);
static int EVTsetup_jobs(CKTcircuit *ckt);
static int EVTsetup_load_ptrs(CKTcircuit *ckt);
int EVTsetup_plot(CKTcircuit* ckt, char* plotname);
/* Allocation macros with built-in check for out-of-memory */
@ -469,6 +469,7 @@ static int EVTsetup_jobs(
/* Allocate/reallocate necessary pointers */
CKREALLOC(jobs->job_name, num_jobs, char *)
CKREALLOC(jobs->job_plot, num_jobs, char *)
CKREALLOC(jobs->node_data, num_jobs, Evt_Node_Data_t *)
CKREALLOC(jobs->state_data, num_jobs, Evt_State_Data_t *)
CKREALLOC(jobs->msg_data, num_jobs, Evt_Msg_Data_t *)
@ -477,6 +478,7 @@ static int EVTsetup_jobs(
/* Fill in the pointers, etc. for this new job */
i = num_jobs - 1;
jobs->job_name[i] = MIFcopy(ckt->CKTcurJob->JOBname);
jobs->job_plot[i] = NULL; /* fill in later */
jobs->node_data[i] = data->node;
jobs->state_data[i] = data->state;
jobs->msg_data[i] = data->msg;
@ -599,3 +601,16 @@ static int EVTsetup_load_ptrs(
return(OK);
}
/* get the analog plot name and store it into the current event job */
int EVTsetup_plot(CKTcircuit* ckt, char *plotname) {
if (ckt->evt->counts.num_insts == 0)
return(OK);
Evt_Job_t* jobs = &(ckt->evt->jobs);
if (jobs) {
jobs->job_plot[jobs->num_jobs - 1] = copy(plotname);
return OK;
}
return 1;
}
Loading…
Cancel
Save