#include /* module history9 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* the short-term historical record consists of a series of ten freeze- frames of the transmitter parameters, formatted the same as the logs: each log is structured as 8 bytes of ascii time of day, followed by 8 bytes of ascii date, followed by nb binary status bytes, followed by 64 metering bytes (32 integers), for a total of nb+80 bytes. return to real-time mode with Esc key in main program loop */ /*****************************************************************************/ history(void) /* read freeze-frames */ /* return to real-time mode with Esc key in main program loop */ { char string[40]; int i,offset; if(parse[4]!=CR) /* argument? */ { if(arg(1,20)) goto abort; histno=atoi(&parse[4]); } else histno=1; logno=0; status[35]&=0x7F; /* exit simulation mode */ backdata(); /* save real-time status */ clkey(); offset=16*(histno-1); for(i=0;i<=7;i++) { tyme[i]=histime[i+offset]; dayt[i]=histime[i+offset+8]; } offset=nb*(histno-1); for(i=0;i=16;i--) /* shift histories */ histime[i]=histime[i-16]; for(i=20*nb-1;i>=nb;i--) histat[i]=histat[i-nb]; for(i=639;i>=32;i--) hismet[i]=hismet[i-32]; for(i=0;i<=7;i++) { histime[i]=tyme[i]; histime[8+i]=dayt[i]; } for(i=0;i