brief option reimplementation.
This commit is contained in:
parent
7703a63230
commit
10997c0fa5
|
|
@ -160,6 +160,7 @@ ft_cpinit(void)
|
||||||
|
|
||||||
cp_vset("prompt", VT_STRING, buf);
|
cp_vset("prompt", VT_STRING, buf);
|
||||||
cp_vset("noglob", VT_BOOL, (char *) &t);
|
cp_vset("noglob", VT_BOOL, (char *) &t);
|
||||||
|
cp_vset("brief", VT_BOOL, (char *) &t);
|
||||||
|
|
||||||
/* Now do a bunch of things that used to be in the spiceinit file
|
/* Now do a bunch of things that used to be in the spiceinit file
|
||||||
* but were too slow to read in...
|
* but were too slow to read in...
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ $Id$
|
||||||
* the listing routines.
|
* the listing routines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include "cpdefs.h"
|
#include "cpdefs.h"
|
||||||
|
|
@ -48,23 +47,6 @@ static char * upper(register char *string);
|
||||||
static bool doedit(char *filename);
|
static bool doedit(char *filename);
|
||||||
static void line_free_x(struct line * deck, bool recurse);
|
static void line_free_x(struct line * deck, bool recurse);
|
||||||
|
|
||||||
// Initial AlmostEqualULPs version - fast and simple, but
|
|
||||||
// some limitations.
|
|
||||||
static bool AlmostEqualUlps(float A, float B, int maxUlps)
|
|
||||||
{
|
|
||||||
assert(sizeof(float) == sizeof(int));
|
|
||||||
|
|
||||||
if (A == B)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
int intDiff = abs(*(int*)&A - *(int*)&B);
|
|
||||||
|
|
||||||
if (intDiff <= maxUlps)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do a listing. Use is listing [expanded] [logical] [physical] [deck] */
|
/* Do a listing. Use is listing [expanded] [logical] [physical] [deck] */
|
||||||
void
|
void
|
||||||
com_listing(wordlist *wl)
|
com_listing(wordlist *wl)
|
||||||
|
|
@ -657,7 +639,7 @@ inp_dodeck(struct line *deck, char *tt, wordlist *end, bool reuse,
|
||||||
struct variable *eev = NULL;
|
struct variable *eev = NULL;
|
||||||
wordlist *wl;
|
wordlist *wl;
|
||||||
bool noparse, ii;
|
bool noparse, ii;
|
||||||
double brief = 0, i;
|
bool brief;
|
||||||
|
|
||||||
/* First throw away any old error messages there might be and fix
|
/* First throw away any old error messages there might be and fix
|
||||||
* the case of the lines. */
|
* the case of the lines. */
|
||||||
|
|
@ -710,9 +692,6 @@ inp_dodeck(struct line *deck, char *tt, wordlist *end, bool reuse,
|
||||||
eev->va_type, (char *) &eev->va_num);
|
eev->va_type, (char *) &eev->va_num);
|
||||||
break;
|
break;
|
||||||
case VT_REAL:
|
case VT_REAL:
|
||||||
if ( strcmp("brief",eev->va_name)==0 ){
|
|
||||||
cp_vset("brief", VT_REAL, (char*) &eev->va_real );
|
|
||||||
}
|
|
||||||
if_option(ct->ci_ckt, eev->va_name,
|
if_option(ct->ci_ckt, eev->va_name,
|
||||||
eev->va_type, (char *) &eev->va_real);
|
eev->va_type, (char *) &eev->va_real);
|
||||||
break;
|
break;
|
||||||
|
|
@ -776,11 +755,9 @@ inp_dodeck(struct line *deck, char *tt, wordlist *end, bool reuse,
|
||||||
|
|
||||||
} /* for (dd = deck; dd; dd = dd->li_next) */
|
} /* for (dd = deck; dd; dd = dd->li_next) */
|
||||||
|
|
||||||
if ( cp_getvar( "brief", VT_REAL, (char *) &i ) ) {
|
/* Only print out netlist if brief is FALSE */
|
||||||
brief = i;
|
cp_getvar( "brief", VT_BOOL, (bool *) &brief );
|
||||||
}
|
if(brief==FALSE) {
|
||||||
// only print out netlist if brief == 0
|
|
||||||
if(AlmostEqualUlps(brief,0,3)) {
|
|
||||||
/* output deck */
|
/* output deck */
|
||||||
out_printf( "\nProcessed Netlist\n" );
|
out_printf( "\nProcessed Netlist\n" );
|
||||||
out_printf( "=================\n" );
|
out_printf( "=================\n" );
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ char *ft_setkwords[] = {
|
||||||
"addcontrol",
|
"addcontrol",
|
||||||
"altshow",
|
"altshow",
|
||||||
"appendwrite",
|
"appendwrite",
|
||||||
|
"brief",
|
||||||
"bypass",
|
"bypass",
|
||||||
"chgtol",
|
"chgtol",
|
||||||
"color<num>",
|
"color<num>",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ alias exit quit
|
||||||
alias acct rusage all
|
alias acct rusage all
|
||||||
set x11lineararcs
|
set x11lineararcs
|
||||||
|
|
||||||
|
*unset brief
|
||||||
|
|
||||||
strcmp __flag $program "ngspice"
|
strcmp __flag $program "ngspice"
|
||||||
if $__flag = 0
|
if $__flag = 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue