DrawGen
jim lesurf (2082) 1438 posts |
OK, I’ve now put a zip here: http://jcgl.orpheusweb.co.uk/temp/DG_graphs.zip This contains my current test/demo program for the DG_graphs procs I’m putting together, along with a suitable example data file, etc. Plus a copy of the existing DGlib. I’d like to replace the ‘droptext’ with the ‘textr’, or at least make that optional. But at present that’s only available from Steve’s build of the DrawGen module. |
Steve Drain (222) 1620 posts |
I had corrupted the original file for that module and then put ABC away in a secure place with a message “never touch again”. ;-) However, I have rewitten the procs in a rather neater fashion and tested them, so here they are: DEFPROCdecode_textr REM text rotated by rightangles INPUT#in_file%,vt$ PROCdecode_vals(4) PROCscale_xy PROCtextr(v%(1),v%(2),v%(3),v%(4),vt$,text_wi%,text_hi%,text_font%,text_col%,text_back%) ENDPROC DEFPROCtextr(x%,y%,rot%,flag%,text$,xsize%,ysize%,font%,col%,bcol%) REM text rotated by rightangles LOCAL a%,b%,c%,d% PROCputw(12) PROChead_here(FALSE) PROCputxy(x%,y%-ysize%DIV2) PROCputxy(x%+(LEN(text$)*xsize%)DIV2,y%+ysize%) CASE rot% OF WHEN 0:a%= 1:b%= 0:c%= 0:d%= 1:REM 000 WHEN 1:a%= 0:b%= 1:c%=-1:d%= 0:REM 090 WHEN 2:a%=-1:b%= 0:c%= 0:d%=-1:REM 180 WHEN 3:a%= 0:b%=-1:c%= 1:d%= 0:REM 270 ENDCASE PROCputw(a%<<16) PROCputw(b%<<16) PROCputw(c%<<16) PROCputw(d%<<16) PROCputw(0) PROCputw(0) PROCputw(flag%) PROCputw(col%) PROCputw(bcol%) PROCputw(font%) PROCputw(xsize%) PROCputw(ysize%) PROCputxy(x%,y%) PROCputs(text$) PROCalign PROChead_now ENDPROC |
jim lesurf (2082) 1438 posts |
Thanks, Steve. :-) All being well, I’ll add that tomorrow and put up a new version of the DrawGen module that includes it. (Currently diverted to task = ‘make dinner’ i.e. Non-maskable interrupt driven… :-) ) |
David Pitt (3386) 1248 posts |
The new code for rotated text was added to the BASIC This little conundrum is down to the differing ways BASIC and ABC handle LOCAL. The modified A little demo. LocalBAS is BASIC and LocalABC is a compiled LocalBAS. REM >LocalBAS c%=&FF PRINT "main prog ";c% PROCanyproc PRINT "main prog ";c% END DEF PROCanyproc LOCAL c% PRINT "1st proc ";c% PROCanotherproc ENDPROC DEF PROCanotherproc PRINT "2nd proc ";c% ENDPROC *LocalBAS main prog 255 1st proc 0 2nd proc 0 main prog 255 *LocalABC main prog 255 1st proc 0 2nd proc 255 main prog 255 *
|
jim lesurf (2082) 1438 posts |
I’ve now put up http://jcgl.orpheusweb.co.uk/temp/DG3p01.zip This contains a new version of the DrawGenMod module, plus source code, and a demo program using the ‘textr’ proc. It seems to work OK here, but if others find it doesn’t, please let me know! I’ve included a demo which simply adds using ‘textr’ to the graphs I’m working on. Now started on polar displays… |
jim lesurf (2082) 1438 posts |
Is the problem wrt local/global confined to the a%, b%, … named variables? It isn’t a problem I’ve encountered so far as I recall, but purely in innocence I’ve probably not named things in a way the hit the problem… so far as I can recall. But it has been many years since the last time I used ABC! So I may have forgotten. |
Rick Murray (539) 13840 posts |
Oh, you mean how one actually understands what LOCAL means, while the other is fingers in ears la la la, Brexit, unicorns, I can’t hear you… ? You mean that, right? |
Steve Drain (222) 1620 posts |
As I said:
;-) |
nemo (145) 2546 posts |
Putting the “variable” into “scoping”. |
jim lesurf (2082) 1438 posts |
FWIW I’ve now put up a new version of the !LP_WowAndFlutter program via a link from http://www.audiomisc.co.uk/software/index.html This now uses the new version of the DrawGen library to generate a DrawFile showing the measured results in graphical form. I’ve included all the ‘C’ source code so that skilled programmers can have a chuckle/sigh at my mistakes. :-) |