From 05c0d50e55570dff0d54d7ec01e5f5699dde7484 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Tue, 28 Apr 2009 21:53:29 +0000 Subject: [PATCH] SetAnalys, maxord --- ChangeLog | 4 ++++ src/frontend/inp.c | 7 ++++++- src/spicelib/analysis/cktdojob.c | 5 +++++ src/spicelib/analysis/cktop.c | 7 ++++++- src/winmain.c | 14 ++++++++------ 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 526708c9e..152b3067b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-26 Holger Vogt + * winmain.c, inp.c, cktop.c: SetAnalyse() modified/added + cktdojob.c: maxord set to minimum 2 (prevent crash in dctran.c:774) + 2009-04-26 Dietmar Warning * devices/cktinit.c: prototype load_alldevs not needed * ngspice.h: float.h before defines.h, some more function mapping in _MSC_VER section diff --git a/src/frontend/inp.c b/src/frontend/inp.c index e50fdd4c9..979451176 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -58,6 +58,9 @@ static bool doedit(char *filename); void line_free_x(struct line * deck, bool recurse); +#ifdef HAS_WINDOWS +void SetAnalyse( char * Analyse, int Percent); +#endif /* uncomment this line for getting deck output after all manipulations into debug-out2.txt. @@ -504,7 +507,9 @@ inp_spsource(FILE *fp, bool comfile, char *filename) if (deck->li_next) { /* There is something left after the controls. */ fprintf(cp_out, "\nCircuit: %s\n\n", tt); - +#ifdef HAS_WINDOWS + SetAnalyse( "Circuit", 0); +#endif /* Old location of ENHtranslate_poly. This didn't work, because it * didn't handle models in .SUBCKTs correctly. Moved to new location below * by SDB on 4.13.2003 diff --git a/src/spicelib/analysis/cktdojob.c b/src/spicelib/analysis/cktdojob.c index a853ace1a..5c651b7d6 100644 --- a/src/spicelib/analysis/cktdojob.c +++ b/src/spicelib/analysis/cktdojob.c @@ -52,6 +52,11 @@ CKTdoJob(void *inCkt, int reset, void *inTask) ckt->CKTtemp = task->TSKtemp; ckt->CKTnomTemp = task->TSKnomTemp; + /* Check options method and maxorder for consistency */ + if (task->TSKmaxOrder < 2) { + task->TSKmaxOrder = 2; + fprintf(stderr,"\nWarning -- Option maxord < 2 not allowed in this build\nSet to 2\n\n"); + } ckt->CKTmaxOrder = task->TSKmaxOrder; ckt->CKTintegrateMethod = task->TSKintegrateMethod; ckt->CKTbypass = task->TSKbypass; diff --git a/src/spicelib/analysis/cktop.c b/src/spicelib/analysis/cktop.c index 4aec50a1d..d5e3d1b5a 100644 --- a/src/spicelib/analysis/cktop.c +++ b/src/spicelib/analysis/cktop.c @@ -16,13 +16,18 @@ static int spice3_gmin (CKTcircuit *, long int, long int, int); static int gillespie_src (CKTcircuit *, long int, long int, int); static int spice3_src (CKTcircuit *, long int, long int, int); +#ifdef HAS_WINDOWS +void SetAnalyse( char * Analyse, int Percent); +#endif int CKTop (CKTcircuit * ckt, long int firstmode, long int continuemode, int iterlim) { int converged; - +#ifdef HAS_WINDOWS + SetAnalyse("op", 0); +#endif ckt->CKTmode = firstmode; if (!ckt->CKTnoOpIter){ diff --git a/src/winmain.c b/src/winmain.c index 7e688d18f..a7138f611 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -200,10 +200,13 @@ void SetSource( char * Name) static int OldPercent = -2; void SetAnalyse( char * Analyse, int Percent) { - char s[128]; + static int OldPercent = -2; + static char Olds[128]; + char s[128]; - if (Percent == OldPercent) return; + if ((Percent == OldPercent) && !strcmp(Olds, Analyse)) return; OldPercent = Percent; + strncpy(Olds, Analyse, 127); if (hwAnalyse) { if (Percent < 0) sprintf( s, "--ready--"); @@ -211,7 +214,7 @@ void SetAnalyse( char * Analyse, int Percent) sprintf( s, "%s : %3u%%", Analyse, Percent); SetWindowText( hwAnalyse, s); InvalidateRgn( hwAnalyse, NULL, TRUE); - WaitForIdle(); + WaitForIdle(); } } @@ -320,7 +323,7 @@ int w_getch(void) // Cursor = normal SetCursor( LoadCursor( NULL, IDC_IBEAM)); // Analyse ist fertig - SetAnalyse( NULL, -1); + SetAnalyse("", -1); // Warten auf die Eingabe do { WaitForMessage(); @@ -842,8 +845,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi ClearInput(); DisplayText(); SetSource( ""); -// SetAnalyse( NULL, -1); - SetAnalyse(" ", 0); + SetAnalyse("Start", 0); UpdateWindow( hwMain); SetFocus( swString);