|
From: doug s. <hig...@ho...> - 2013-06-12 16:37:56
|
>> A) generate .fwplay
>> freewrl 1.wrl -R -N fly2
>> (then hit "`" to toggle logging on, then off, hit 'x' to snapshot, hit 'q' to quit)
>> creates:
>> /recording/fly2.fwplay
>> /freewrl_tmp/freewrl.snap.0001.bmp
>> /freewrl_tmp/logfile.log
>> .
> The recording seems to be working well but....
> "`" - I can't see any logging whatsoever as my keyboard is PT and
> triggering a "`" involves a combination of Shift+and another key.
> So perhaps I'm not triggering the logging correctly.
Paulo,
Thanks again for recommending automated testing. We'll see if this 'input capture' method I chose works.
Sorry that was a bad character to pick - it just worked well on my keyboards. But I thought it should still work with 'modifiers' like shift, since it's the translated character I trigger on.
Having said that, the logfile.log would be empty -nothing in it.
Hypotheses:
H0: on your system closing an empty file doesn't save it?
to test that, open freewrl with 1.wrl scene and no other command line parameters, put the ` character. On the console/terminal you should see it say something about logging.
Then hit \ It should write something to the logging file. Do ` again. On the console it should say something about stopping logging. Then in /freewrl_tmp it should show logging.log.
H1: the ` character is a different numerical value
To test: pick another character you like and change it in Mainloop.c L.3355
case '`': { toggleLogfile(); break; }
If another key works that you prefer, and isn't being used for something else in that function, then email me back and I'll change it in CVS.
> Hitting "x" for a snapshot generates a png file and not a bmp.
.png is correct for -R and ordinary freewrl snapshots on linux. (example above was win32) (the .bmp on linux is only for -F, -P modes)
> The movements whilst recording are slow, I noticed your note in the code
> regarding "reduce empty meaningless records" but I wonder if it is
> feasible for anyone to generate recordings with that level of slowness?
> If I interpreted correctly your intention, I wonder If it wouldn't be
> better to exclude those "empty meaningless records" at flush time or
> similar and still keep the fluidity of a normal app.
Problem: there are no completely empty records. The timestamp keeps advancing. The fly navigation mode and various interpolators keep doing work with only another frame and timestamp. To make the input-capture method of testing work reliably I'm about 97.3% sure it needs to replay all the timestamps/frames the Record method had. (a small amount of doubt - perhaps some hacking on fly mode is all it would need)
Having said that, I just picked .5 seconds arbitrarily. The easiest change would be to make this number smaller ie .1 seconds -that would give you 10 fps, and 5x as many .fwplay records, although many of those records would be 'short'. It would also take longer to replay, but if you have a long perl automated test suite, you could sip a coffee or read email while it replays.
Test: try changing that .5 to .1 and do a -R (recording) and see if .1 is OK for you, if so let me know.
.
>> B) generate test fixture
>> freewrl -F -N fly2
>> creates:
>> /fixture/fly2.0001.bmp
>> /fixture/fly2.log
>> .
> This does seem to play the recording well but ...
> - The bmp file created is unreadable in my system, it looks like a file
> with a bunch of data and no header....
Q. .bmp is a Microsoft image file format. do you have GraphicsMagick installed? If so then at command level:
gm display fly2.0001.bmp
should show it - I've tried it on Ubuntu.
GraphicsMagick is a re-write of an older ImageMagic(k?) utility - and there's also a perl interface (perlMagick) for calling graphicsMagick functions directly (bypassing the commandline syntax).
http://www.graphicsmagick.org/
http://www.graphicsmagick.org/perl.html
(some linux gurus hate anything microsoft. And I stewed for a few days before conceding it was the easiest and maybe even the best image format choice for this testing job - no compression, small generic header, I had the C code working for win32, and -I thought- displayable on all platforms with graphicsmagick)
If you try graphicsMagick and it doesn't display, email me off list and attach the .bmp -I'll check if it displays on win32.
(perhaps I didn't do the header right for 64bit. the header is 58 bites, starting with 2 byte "BM", then a struct of 54 bytes. I'm assuming the 4 byte integers aren't padded out to 8 bytes in the struct in 64 bit. If they are then I need to change the way I malloc and write the header so it works better on 64 bit. Are you compiling for 64 bit?)
> - I don't see any logfile being created.
>> C) generate playback
>> freewrl -P -N fly2
>> creates:
>> /playback/fly2.0001.bmp
>> /playback/fly2.log
>> .
> Same thing here unreadable bmp and no logfile.
>> D) run a perl script to compare fixture and playback files
> I think this bit will be rather straightforward to achieve once
> everything is oiled enough.
> Following on the initial code I have on github for the testing bit my
> plan is to have a script that drives FreeWRL and generates playbacks to
> then compare to the fixtures.
Bravo - I have about 1 day of perl, about all I remember is she-bang = #!.
I have a tests/ folder that has a lot of tests besides the 1-52, and in sub-folders. So before generating .fwplays, I need a script to find all the .wrl and .x3d in current and subfolders, and generate a script that will run freewrl -R on each of them in sequence, so I can spend a couple of intense 'guided' hours generating .fwplays that I can then .zip and send to others, along with the expanded tests folder. How do I find all the .wrl and .x3d using perl?
-Doug
|