SetAnalys, maxord

This commit is contained in:
h_vogt 2009-04-28 21:53:29 +00:00
parent c7211d09d2
commit 05c0d50e55
5 changed files with 29 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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){

View File

@ -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);