[00:27:52] <jepler> http://linuxcnc.org/docs/devel/html/hal/drivers/ http://emergent.unpy.net/index.cgi-files/sandbox/l2h/drivers.html
^^ I'm working on a new piece of software to convert the docs from lyx to html; comments?
much (much much) nicer!
I've only tried it on the one small document so far..
are the shaded regions from CSS, or is that in the HTML?
the darker blueish-slightly-purple background makes text a little hard to read
it uses CSS; there's a <style> in the html document
I am not in love with those colors, but I wanted some color on headings and such
yep. they do stand out, which is quite useful when writing the code
also I note that the parport pin diagram actually appears in the new page, which is also nice
yeah that's one of the things I think is important :-P
I changed it to a new shade of blue
much easier to rea
interesting - the pluto diagram shows up in the old version
yeah I don't actually know what "breaks" some of the image files
but it's a different size
the new one is smaller, and a little blurry from the scaling
for some reason, I can run "convert -density 96 pluto-pinout.eps ../out/pluto-pinout.png" from the commandline but the same thing fails when run from my program .. no error message, just an exit value of 127
['convert', '-density', 96, srcfile, destfile])
that's twice today Python has disappointed me (by hiding the error that '96' was not a stirng)
OK, re-rendered the images at 96dpi
they're still different sizes and it's still not particularly legible :(
* jepler bumps to 100dpi
it looks much better now
it went over 1024-wide though :(
there have got to still be a few people with 1024-wide screens, though I don't know any of them
it's 631x336, according to Mozilla
[00:49:10] <SWPadnos> http://emergent.unpy.net/index.cgi-files/sandbox/l2h/pluto-pinout.png
I thought we were talking about parport pinout being illegible
oh, nope :)
you should be able to tell convert to make it a certain pixel size
err - certain resolution
um - you know, you can tell it how many pixels to make the output image
yes but I doubt all images should "nearly fill a 1024x768 screen"
no, but I think you can limit it to a certain size as well
so you do 96DPI or something, but limit to the smaller of 96DPI or 1000 pixels wide
it's been a while since I messed around with imagemagick though, so I can't tell you the options to do that
yeah, I figured it out finally
['convert', '-density', '100', '-resize', '1000x9999>', srcfile, destfile]
I should probably find the courage to try some other portions of the emc docs next
huh, I didn't know about this (apparently deprecated?) scripting extension for html: http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.7.1.1
I wonder if any browsers implement it, and whether stuff like webmail and facebook correctly strip it
doesn't seem that firefox does
I think -density .. -resize .. gives worse results .. as though it first produces the full-sized image from the vector source, then resizes the bitmap image
I also need to figure out what to do about cross-document links..
jepler: that looks very promising
how is hal_parport_block_diagram.dxf converted to .png? is that vec2web?
there are a lot of font styles you can specify in qcad but it doesnt render them any different in qcad
fenn: by manually running qcad, I think -- see docs/src/README
though the .eps files there may or may not be generated from a win9x cad package running on an old system of jmk's
ok i thought it was automatic since there isnt anything in cvs
dxf->eps or ps is manual; eps or ps -> png is part of the latex2html step in docs/src/Submakefile
COOOOOL -- I just got cross-document links to work
<xsl:value-of select="document('xref.xml')//label[@anchor=current()/@target]/@src"/>#<xsl:value-of select="@target"/></xsl:attribute>[->]</A>
oh holy crap
xsl is a hard language to love but I am sure pleased with the results I've been able to get
"look around in xref.html for a <label> whose anchor= matches the desired one, and substitute in its src=, followed by #, followed by ... and stuff that all into the href= of the <A>"
yes if you say so
that seems like a very basic thing to need
I've now converted all of the hal/ directory of docs with my new software: http://unpy.net/emc2-docs-hal
(try any .html or .xml file; they should look the same)
the software: http://git.unpy.net/view?p=l2h.git;a=shortlog;h=xml
hm the links in the html files are to the xml files...
jepler: I find myself getting lost (losing track of the heirarchy) since only font size gives those cues
maybe put the numbers in the headers like latex does?
hm something goes wrong in comp.html
oh, yes it sure does
[03:33:46] <jepler> http://unpy.net/emc2-docs-hal/comp.xml
i want something like hal_input.py for the labjack, but it is iput and output, also analog(float) and digital, and counters and timers. Do I extend KRAL to allow these pin/param types?
tomp: analog inputs are already supported -- should be in the category of "A" in this case
I'm not sure about analog outputs; they don't seem to be supported by the linux input layer (only LEDs like keyboard status LEDs, seem to be)
did you invent the linux_event scheme?
I wrote linux_event.py but modeled it on other software which uses /dev/input on linux
while on this topic, is it possible to grab mouse events with hal_input?
fenn: yes, you can use a mouse with hal_input; you have a choice of sharing it with the X server, or using it exclusively by putting "+" at the start of the device specifier.
how do i share it? i get permission denied when i try to use event1
see section PERMISSIONS AND UDEV of the manpage
(by default on ubuntu the console user doesn't get the necessary permission on input devices)
analog outputs are analog onlyafter the device coverts a binary number into the analog voltage, so ther name is missleading, it's really writing a 'word' to a 'port', my bad
so changing the file permissions would not work?
crw-rw-r-- 1 root root 13, 65 2007-09-21 16:07 event1
halcmd: loadusr hal_input -R 1
OSError: [Errno 13] Permission denied: '/dev/input/event1'
are you in group 'root'? It opens the device with O_RDWR.
hm i never thought of adding write access
that was much easier than figuring out how to use udev :)
this is sweet
got a format example of the device specifier ( eg: /dev/usb/labjacku3_0 ) with the loadusr hal_input command?
only if the Linux device is called /dev/input can it be used with hal_input
if it's under /dev/usb it's some other kind of device which requires a different program
sounds like some versions of linux tried to treat the device like a HID device (the type hal_input is useful for) but this was undesirable, leading to weird workarounds.. http://www.labjack.com/forums/index.php?showtopic=1370
(HID supports analog inputs and outputs, but linux's /dev/input seems to have poor or no abilities to work with analog outputs)
hmm, xemets joypad >is< in /dev/input i'm working this the wrong way trying to find a simple solution ( hal_input, python... ) looks like time for a real 'c' driver
you might have an easier time hacking on their python driver
its definitely more discoverable with the help() function
yeah the labjackpython.zip
i'm sure it does something :)
i managed to get data out of it using labjackpython, i can set up the queries and get the data and set the data ok ( a bit z-80 ish )
it is a microntroller after all
and am working on the communications to hal
I xemet used hal_joystick, which is in /dev/input , but thats not a pre-requisite, (he doesnt use hal_input ), maybe thats a starting point
you can tell I'm excited about this l2h project because I've stayed up past midnight working on it :-P
* jepler pushes the latest copy to his webiste once more
if I fix any more bugs this program will go over 1000 lines though :(
4 warnings, 0 errors were found!
make: *** [../out/bug3.tidy.html] Error 1
hmm looks like 'tidy' has an interesting definition of exit values
hal_joystick.c gets a nice struct when the joystick handle (jsfd) is read.
The struct sez what kind of event, author and value.
Hal_joystick then inspects the struct for a known type , evaluates and places stuff on pins.
How does the struct get filled in?
Does the device constantly create new data ready for retrieval?
when something happens, the device filld in a struct and makes it available for reading
so when hal_joystick gets it, it's filled in
right, the device knows about events, and makes a short report to notify a change. later a query can be made about the specifics
so a device that does not generate such a struct is 'another story'
yes, probaly a story in a different language
c should so
its not necc to have teh event struct, just some way to tell there's news
I bet both are necessary
you need to know how to tell there's new (that's the select call), and you also have to know how to interpret the news (that's the "language=sanskrit" part)
yes, detect change then if true, evaluate is great,
i meant an event struct tied the driver to linux event types which are wrapped in keyboard/mouse/rumblepad thinking, not machine/laboratory i/o thinking.
I bet when you read from the labjack, the data is in some predetermined format (a filled-in struct)
you read data A with this cnmd, data B with that command, timer Z withthe other command....
like z-80 peripherals
ok. have you looked into the python or C source to see how they do it?
used it, read a bit of thier code yes
unless they're sending a command to the unit to get the data before returning it to the calling program, their library is likely looking at full packets and only returning one item
"it's easier to use" that way
yes a unique (very) cmd to get an individual data... not a full set of data and send this one back to caller. maybe what you say is true at some lower level, i'll look. thx
well, it looks like that may not help
I'm just scanning through the python library, nad 99% of the functions are Windows only - they'll raise exceptions on Linux
right, the linux functs are fewer but more robust
so far, ervery function except open is Windows only
i think you're right about the whole shebang being available tho, if you'd like to look at def Read(Handle, Stream, numBytes):
:) i used a folding editor to remove the windows cruft , almost folded the file away :)
line 1515 is Linux Read
and if the lower level ( non python approach ) is used, then bulkread and bulkwrite hint that the whole data is available ( file labjackusb.c lines 108, 134 resp )
there you go :)
it does look as though you need to do some initialization of the device itself, but I'd hope you could tell it to just keep scanning all channels
right, me --> rtfm ;)
me -> head out for breakfst :)
thanks, have a waffle on me
any last comments before I make the new converter the default for emc 2.2 and beyond? http://unpy.net/emc2-docs-new/
just one, nice work
jepler: looks great
hm, multiple index entries with the same text don't work
and there are more problems with Formula
jepler: it looks great to me, thanks for adding the numbers
jepler: in http://unpy.net/emc2-docs-new/gcode_tool_compensation.html
there are some spurious (I think) "inner_position 0"
hmm I'll look
I wonder what that's about
there's also something funky with the 'Caption' in that file..
it's very nice to see those images again
cradek: fixed 'inner_position' and 'caption' in Tool Compensation
and yes, having the images work is one of the biggest bonuses
it's too bad this will break all the old documentation links though
jepler: wouldn't pages with links help there out?
good night all