#include /* module maps9 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* 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 */ /****************************************************************************/ maps(void) /* display grid of valid servo positions */ { char string[20]; int block,i=1,j,k,color,x,y,tempno; tempno=logno; clkey(); clear(); backdata(); /* save real-time status */ font(1); text(PALEBLUE,0,479,"LOG STORAGE"); txnumber(); text(GREEN,200,479,"GREEN -- LOG STORED BY STATUS CHANGE"); text(YELLOW,200,465,"YELLOW -- LOG STORED BY CLOCK"); text(BLUE,200,450,"BLUE -- LOG STORED MANUALLY"); text(RED,200,435,"RED -- LOG STORED AT BOOT"); logno=1; rect(DARKGREY,0,423,30,20); texcolor(WHITE); for(i=0;i<=19;i++) /* label vertical axis */ { itoa(30*i+logno,numb,10); /* convert to string */ tex(5,418-i*20,numb); } for(j=0;j<=19;j++) /* display 600 logs */ { y=400-20*j; block=counter[0]-logno+1; if(block>30) block=30; if(getblock(logno,block)) goto abort; logno=logno+30; for(i=0;i=counter[0]) break; } setcolor(WHITE); line(220,420,220,20); /* tens marker */ line(420,420,420,20); line(620,420,620,20); k=caps(); abort: restdata(); /* restore real-time status */ keyboard[0]=k; prompt(keyboard); logno=tempno; refresh=1; }