-
-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Braille Display Driver for Seika40/80 #2452
Comments
Attachment Seika.py added by Ulf on 2012-06-15 10:28 |
Attachment userGuide.en.html added by Ulf on 2012-06-15 10:30 |
Attachment userGuide.de.html added by Ulf on 2012-06-15 10:31 |
Comment 1 by jteh on 2012-06-15 10:40 If possible, please provide the User Guide snippets in t2t format, as this is the format we use for our User Guide. The format is fairly simple. You can find the t2t file for the English User Guide here. |
Attachment userGuide.de.t2t added by Ulf on 2012-06-15 11:03 |
Attachment userGuide.de.2.t2t added by Ulf on 2012-06-15 11:04 |
Attachment userGuide.en.t2t added by Ulf on 2012-06-15 11:06 |
Comment 2 by jteh on 2012-06-18 03:01 The module should start with a lower case letter; i.e. seika.py instead of Seika.py. This also means
Is there any need for these constants? IN this case, they don't seem to serve any purpose, since they include the number anyway.
This could be better written as:
Similar for the other constants just below it.
This is never used, so should be removed.
This map doesn't seem to correspond in any way with the bytes received from the display, which might make the code cleaner. I'll cover this more below. Also a cosmetic issue: the entries are indented with a tab and a space instead of just a tab.
I assume the BTHENUM entry is debugging? Also, the USB\ part seems redundant if this is for USB ids only.
Should start with a lower case letter as above.
Perhaps
Defining this here seems redundant, as it's always set in In
I don't understand what this code does. It doesn't seem like it will ever succeed. Can you explain?
No need for the cells variable; better written simply as:
This won't have the intended effect because you haven't declared it as a global at the top of the function. Anyway, it's never used, so should be removed. In
I'd probably write chr(0) as "\0" to avoid an unnecessary function call.
I'm possibly misunderstanding this, but I don't think it's necessary. Braille will always send exactly numCells to the display, padding with 0 if necessary. In I know this stuff is always nearly impossible to write elegantly. However, there are a few important problems here:
Btw, another cosmetic thing: j += 1 is probably nicer than j = j + 1. You can do similarly with other operators. Please let me know if you need further explanation on any of these points. Thanks once again. |
Comment 3 by Ulf on 2012-06-19 15:05 |
Comment 4 by jteh (in reply to comment 3) on 2012-06-19 23:14
Do the first 2 bytes sent by the display tell you what kind of message it will be (routing or normal key)? If so, you can read 2 bytes, examine the data and then read 10 more bytes or 20 more bytes as required.
No problem. My code review is not meant to be accusatory. Hopefully, it's helpful and will ensure the best possible code quality. |
Attachment seika.py added by Ulf on 2012-06-20 15:22 |
Comment 5 by Ulf on 2012-06-20 15:38
|
Comment 6 by drein on 2012-06-27 12:43 |
Comment 7 by jteh (in reply to comment 2) on 2012-07-18 08:32
If you did want to simplify this and avoid the big if/elif block, you could have a list of keys like this:
Then you can grab the bytes, make them into a 16 bit number and check for each bit to know whether that key is pressed. If you're not comfortable doing this, it's probably best to leave it as is, since you'll be the maintainer of the driver. |
Comment 8 by jteh (in reply to comment 6) on 2012-07-18 10:15
This is because the Seika displays connect at 9600bps, so every single update to the display takes almost a tenth of a second: 88 chars / (9600 bps / 10 bits per char) = 0.092 sec. So, if you type 10 characters, it'll take 1 second to update, excluding cursor blinking, etc. The solution is to only allow one update in this interval. This can be done by using a timer. If the timer is not running, send to the display and set a timer for this delay which does a delayed update. If the timer is running, set a variable for the delayed update and return. If you're not sure how to code this, I can do it, though I'll need someone with a display to test it. |
Comment 9 by Ulf on 2012-07-18 11:26
|
Comment 10 by jteh (in reply to comment 9) on 2012-07-18 12:22
baum uses 19200, which is twice as fast. Also, for a 40 cell display, it sends about half the characters (no interspersed nulls), so it's four times as fast. I can't speak for hedo, as I don't own one.
It's probably possible in some cases if there are very fast updates. |
Comment 11 by jteh (in reply to comment 8) on 2012-08-03 07:09
Actually, this solution won't work because braille runs in the main thread and these display calls block, thus blocking the rest of NVDA. I need to think more about a workable solution. |
Comment 12 by Ulf on 2012-08-03 11:42
This was never held in my tests. I have try to write very fast, but in this time I can not read ;) And if I put a finger on a key, ok in this case it takes a little bit, but not in seconds, only in parts of seconds. I have test it with 40 and 80 cell displays. |
Comment 13 by jteh (in reply to comment 6) on 2012-08-06 07:10
Can you be more precise? What application/control were you testing this in? How fast were you writing (roughly how many characters per second or what did you type and how long did it take)? How long did it take before all characters were displayed? Did it really take several seconds or do you just mean there was a noticeable delay? @ulf: Any reason for using upper case key names rather than lower case as is the case elsewhere in NVDA? |
Comment 14 by jteh on 2012-08-06 07:11 |
Comment 15 by jteh on 2012-08-08 08:21 Further issues (such as the speed issue) should be filed as separate tickets if they need to be addressed. |
Reported by Ulf on 2012-06-15 10:26
Braille Display Driver for Seika Version 3, 4, 5 (40 cell) and Seika 80.
The Seika displays are connected via USB, it has 8 buttons and 80/80 cells with cursor routing keys.
The text was updated successfully, but these errors were encountered: